import request from '@/config/axios'

// 运费 VO
export interface ShipFeeVO {
  id: number // 编号
  location: string // 地址
  usPrice: number // 单价
  remark: string // 备注
}

// 运费 API
export const ShipFeeApi = {
  // 查询运费分页
  getShipFeePage: async (params: any) => {
    return await request.get({ url: `/su/ship-fee/page`, params })
  },

  // 查询运费详情
  getShipFee: async (id: number) => {
    return await request.get({ url: `/su/ship-fee/get?id=` + id })
  },

  // 新增运费
  createShipFee: async (data: ShipFeeVO) => {
    return await request.post({ url: `/su/ship-fee/create`, data })
  },

  // 修改运费
  updateShipFee: async (data: ShipFeeVO) => {
    return await request.put({ url: `/su/ship-fee/update`, data })
  },

  // 删除运费
  deleteShipFee: async (id: number) => {
    return await request.delete({ url: `/su/ship-fee/delete?id=` + id })
  },

  // 导出运费 Excel
  exportShipFee: async (params) => {
    return await request.download({ url: `/su/ship-fee/export-excel`, params })
  }
}